package com.baseweb.webadmin.core.constants;

import java.util.ArrayList;
import java.util.List;

public enum AdPositionTypeNow {
    INDEX_BIGADLUNBO(1,"首页全国大广告"), LIST_ADSMALL(2,"首页全国中间小广告"), CURRENT_GUESS(3,"首页全国右侧猜你喜欢"), CLASSIC_WEDDING(4,"首页婚礼预约"),
    CLASSIC_WEDDINGRIGHT(5,"首页婚礼预约右侧"),INDEX_TEBIETUIJIAN(6,"首页特别推荐"),INDEX_CEHUASHILEFT(7,"首页策划师左侧"),
    INDEX_CEHUASHICENTER1(8,"首页策划师中间1"),INDEX_CEHUASHICENTER2(9,"首页策划师中间2"),INDEX_CEHUASHICENTER3(10,"首页策划师中间3"),INDEX_CEHUASHIREMEN(11,"首页热门策划师"),
    INDEX_ZHUCHIRENLEFT(12,"首页主持人左侧"),INDEX_ZHUCHIRENCENTER1(13,"首页主持人中间1"),INDEX_ZHUCHIRENCENTER2(14,"首页主持人中间2"),
    INDEX_ZHUCHIRENCENTER3(15,"首页主持人中间3"),INDEX_ZHUCHIRENREMEN(16,"首页热门主持人"),INDEX_SHEYINGSHILEFT(17,"首页摄影师左侧"),
    INDEX_SHEYINGSHICENTER1(18,"首页摄影师中间1"),INDEX_SHEYINGSHICENTER2(19,"首页摄影师中间2"),INDEX_SHEYINGSHICENTER3(20,"首页摄影师中间3"),
    INDEX_SHEYINGSHIREMEN(21,"首页热门摄影师"),INDEX_SHEXIANGSHILEFT(22,"首页摄像师左侧"),INDEX_SHEXIANGSHICENTER1(23,"首页摄像师中间1"),
    INDEX_SHEXIANGSHICENTER2(24,"首页摄像师中间2"),INDEX_SHEXIANGSHICENTER3(25,"首页摄像师中间3"),INDEX_SHEXIANGSHIREMEN(26,"首页热门摄像师"),
    INDEX_HUAZHUANGSHILEFT(27,"首页化妆师左侧"),INDEX_HUAZHUANGSHICENTER1(28,"首页化妆师中间1"),INDEX_HUAZHUANGSHICENTER2(29,"首页化妆师中间2"),
    INDEX_HUAZHUANGSHICENTER3(30,"首页化妆师中间3"),INDEX_HUAZHUANGSHIREMEN(31,"首页热门化妆师");

    private int code;
    private String name;
    AdPositionTypeNow(int code, String name){
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static List<AdPositionTypeNow> getAllData(){
        List<AdPositionTypeNow> result = new ArrayList<AdPositionTypeNow>();
        for (AdPositionTypeNow current : AdPositionTypeNow.values())
        {
            result.add(current);
        }
        return result;
    }

    public static AdPositionTypeNow getNameByCode(int code){
        List<AdPositionTypeNow> allData = getAllData();
        for (AdPositionTypeNow status : allData){
            if (status.getCode() == code){
                return status;
            }
        }
        return null;
    }
    public static List<String> getAdPositionTypeOpt(){
        List<String> list = new ArrayList<>();
        for (AdPositionTypeNow current : AdPositionTypeNow.values())
        {
            String string = current.getCode() +";"+ current.getName();
            list.add(string);
        }
        return list;
    }
    public static void main(String[] args) {
        Integer t = 10;
        System.out.print(getNameByCode(t).getName());
        List<AdPositionTypeNow> list = getAllData();
        System.out.println(list.get(0).getCode());
        System.out.println(list.get(0).getName());
    }
}
